]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
polkitAgent: Also show user avatar for root user
authorJonas Dreßler <verdre@v0yd.nl>
Sun, 23 Jun 2019 10:15:12 +0000 (12:15 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Tue, 5 Nov 2019 17:52:31 +0000 (18:52 +0100)
Show the user avatar for all users, including the root user. The root
user will always have the generic avatar, but it looks more consistent
than showing no avatar at all.

This way we also don't have to worry about the spacing introduced by the
polkit-dialog-user-layout CSS class, which would give the
"Administrator" label a small offset to the left.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/788

js/ui/components/polkitAgent.js

index 6c519a647c239333374b3af8fc5d97fbb5e75923..30d04d5c5d69fb3bea61ea361950c02737e42610 100644 (file)
@@ -62,7 +62,6 @@ var AuthenticationDialog = GObject.registerClass({
             iconSize: DIALOG_ICON_SIZE,
             styleClass: 'polkit-dialog-user-icon',
         });
-        this._userAvatar.hide();
         userBox.add_child(this._userAvatar);
 
         this._userLabel = new St.Label({
@@ -305,12 +304,10 @@ var AuthenticationDialog = GObject.registerClass({
         let userName = this._user.get_user_name();
         let realName = this._user.get_real_name();
 
-        if (userName !== 'root') {
+        if (userName !== 'root')
             this._userLabel.set_text(realName);
 
-            this._userAvatar.update();
-            this._userAvatar.show();
-        }
+        this._userAvatar.update();
     }
 
     cancel() {